#pragma once
#include<thread>
#include<mutex>
#include<list>
struct nalu{
	nalu() {
		m_data = NULL;
		m_size = 0;
	}
	unsigned char* m_data;
	unsigned int   m_size;
};
class queuelist
{
public:
	queuelist(){
		
	}
	~queuelist(){
	
	}
public:
	bool send_nalu(unsigned char* data, int size) {
		nalu naluint;
		naluint.m_data = (unsigned char*)new char[size];
		naluint.m_size = size;

	}

public:
	nalu read() {
		std::unique_lock<std::mutex> lock(m_mutex);
		if (m_list.size() > 0) {
			nalu naluint = m_list.front();
			return naluint;
		}
		return nalu();
	}
private:
	bool push(nalu naluint) {
		std::unique_lock<std::mutex> lock(m_mutex);
		m_list.push_back(naluint);
	}

	int  size() {
		std::unique_lock<std::mutex> lock(m_mutex);
		int size = m_list.size();
		return size;
	}
private:
	std::list<nalu> m_list;
private:
	std::mutex m_mutex;;
};

